home *** CD-ROM | disk | FTP | other *** search
/ Practical Algorithms for Image Analysis / Practical Algorithms for Image Analysis.iso / LIBIP / PH.H < prev    next >
C/C++ Source or Header  |  1999-09-11  |  1KB  |  53 lines

  1. /* 
  2.  * ph.h
  3.  * 
  4.  * Practical Algorithms for Image Analysis
  5.  * 
  6.  * Copyright (c) 1997, 1998, 1999 MLMSoftwareGroup, LLC
  7.  */
  8.  
  9. /*
  10.  * P(oly_)H(ull).H
  11.  *
  12.  */
  13.  
  14. #ifndef _PH_H_
  15. #define    _PH_H_
  16.  
  17.  
  18. /*
  19.  * point struct
  20.  */
  21. typedef struct spoint {
  22.   short x;
  23.   short y;
  24. } Sp;
  25.  
  26.  
  27.  
  28. /*
  29.  * boundary struct
  30.  */
  31. typedef struct Bdy {
  32.   int ident;                    /* Bit Bdy_ccw tells whether it's counterclockwise */
  33.   /* Needed for convex_hull() only */
  34.   long per;                     /* no. pixels in 8-connected perimeter */
  35.   /* Never used in current version of polyapprox.c */
  36.   long vn;                      /* no. distinct vertices in v[] */
  37.   Sp *v;                        /* array of vn+1 vertices, v[0]==v[vn] (malloc spc) */
  38.   long an;                      /* no. vertices in polygonal approximation */
  39.   Sp **ap;                      /* approx'n: ary of 'an' ptrs into v[](malloc spc) */
  40.   float err;                    /* approximation error tolerance */
  41.   /* output parameter = 
  42.    * -1 (set initially)
  43.    * 0 (no error in the pol approx
  44.    * >0 = tol, actual tolerance
  45.    */
  46.   int hn;                       /* no. vertices in convex hull of polyg. approx'n */
  47.   /* used in convex_hull() only */
  48.   Sp ***hpp;                    /* convex hull: ary of hn ptrs into ap[] */
  49.   /* used in convex_hull() only */
  50. } Bdy;
  51.  
  52. #endif /* _PH_H_ */
  53.